import request from '@/utils/request'

// 查询公链列表
export function list(query) {
  return request({
    url: '/system/crypto/chainAndCurrency/chain/pageList',
    method: 'get',
    loading: true,
    params: query
  })
}

// 查询公链详情
export function getChainInfo(id) {
  return request({
    url: '/system/crypto/chainAndCurrency/chain/' + id,
    method: 'get',
    loading: true
  })
}

// 新增公链
export function addChain(data) {
  return request({
    url: '/system/crypto/chainAndCurrency/chain',
    method: 'post',
    loading: true,
    data: data
  })
}

// 修改公链
export function editChain(data) {
  return request({
    url: '/system/crypto/chainAndCurrency/chain',
    method: 'put',
    loading: true,
    data: data
  })
}

// 删除公链
export function removeChain(id) {
  return request({
    url: '/system/crypto/chainAndCurrency/chain/' + id,
    method: 'delete',
    loading: true
  })
}

// 获取公链列表
export function optionSelect() {
  return request({
    url: '/system/crypto/chainAndCurrency/chain/optionSelect',
    method: 'get',
    loading: true
  })
}

// 币种列表
export function currencyList(query) {
  return request({
    url: '/system/crypto/chainAndCurrency/currency/pageList',
    method: 'get',
    loading: true,
    params: query
  })
}

// 查询币种详情
export function getCurrencyInfo(id) {
  return request({
    url: '/system/crypto/chainAndCurrency/currency/' + id,
    method: 'get',
    loading: true
  })
}

// 新增币种
export function addCurrency(data) {
  return request({
    url: '/system/crypto/chainAndCurrency/currency',
    method: 'post',
    loading: true,
    data: data
  })
}

// 修改币种
export function editCurrency(data) {
  return request({
    url: '/system/crypto/chainAndCurrency/currency',
    method: 'put',
    loading: true,
    data: data
  })
}

// 删除数据
export function removeCurrency(id) {
  return request({
    url: '/system/crypto/chainAndCurrency/currency/' + id,
    method: 'delete',
    loading: true
  })
}
